import App from "./App";
import uView from "uview-ui";
Vue.use(uView);
// #ifndef VUE3
import Vue from "vue";
import "./uni.promisify.adaptor";
import "./intercept/intercept.js";

// import uniID from 'uni-id'
// Vue.use(uniID)
// import {$api} from '@/utils/api.js'
// const $api = require('./utils/api.js').API

Vue.prototype.$image = "https://songcan.xyct1688.com/";
Vue.filter("formatTime", function (timestamp) {
  const date = new Date(timestamp * 1000);
  let year = date.getFullYear();
  let month = date.getMonth() + 1;
  let day = date.getDate();
  let hours = date.getHours();
  let minutes = date.getMinutes();
  let seconds = date.getSeconds();
  month = month > 9 ? month : "0" + month;
  day = day > 9 ? day : "0" + day;
  hours = hours > 9 ? hours : "0" + hours;
  minutes = minutes > 9 ? minutes : "0" + minutes;
  seconds = seconds > 9 ? seconds : "0" + seconds;
  const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  return formattedTime;
});
Vue.config.productionTip = false;
App.mpType = "app";
const app = new Vue({
  ...App,
});
app.$mount();
// #endif

// #ifdef VUE3
import { createSSRApp } from "vue";
export function createApp() {
  const app = createSSRApp(App);
  return {
    app,
  };
}
// #endif
